Repository navigation
Conversation
Scans src, server, Dockerfiles, scripts and the example configs for obp/vX.Y.Z and quoted version literals below v5.1.0; any hit must be listed in BELOW_V510 with a reason.
obp-api-contract/contract.json records verb, path, source, needles, the version constants each path is built from, and the response fields the code reads, for the 28 fixed calls of the front end and the server.
snapshot.py reads the public resource docs of each version in contract.json and records the operation id and response fields of every call; snapshot.json was taken from k8s.openbankproject.com (OBP-API v7.0.0, 474d4bcc).
server/test/obpApiContract.test.ts checks that every needle and version constant is in its source, that every line building an OBP-API path is listed, that the snapshot matches the contract, and that every call and every field it reads is documented unless recorded as a gap.
A literal path segment also matches a documented placeholder, so a call whose own endpoint is gone could match a neighbouring endpoint when the snapshot is retaken, and the tests would pass against the wrong fields. snapshot.py now compares each call's operation with the snapshot.json already on disk: if one differs it lists the calls and writes nothing, unless --accept-rebind is given. A path with no /obp/vX.Y.Z prefix is recorded as missing and unversioned instead of stopping the script. The file is the same in every repository that keeps an OBP-API contract.
…he tests on every pull request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds an offline contract between API Explorer II and OBP-API, so a breaking OBP-API change shows up in
npm testinstead of in a running Explorer.obp-api-contract/contract.jsonlists the 28 fixed OBP-API calls the front end and the server make (verb, path, source file, the text that makes the call, the version constants the path is built from, and the response fields the code reads), andobp-api-contract/snapshot.jsonrecords what OBP-API documents for each of them; refresh it withpython3 -I obp-api-contract/snapshot.py --base https://k8s.openbankproject.com(public resource docs, no credentials).server/test/obpApiContract.test.tsfails when a listed call or version constant is no longer in its source, when a line that builds an OBP-API path is not listed, when the snapshot does not match the contract, or when a call's endpoint or a field the code reads is not documented, unless the entry records it as a known gap (undocumented_fields), and it also fails once such a gap gets documented, so the list only shrinks.server/test/obpApiVersion.test.tsfails on anyobp/vX.Y.Zor quoted version literal below v5.1.0 in the sources, since deployments can switch those versions off; there are none today.The recorded gaps are fields OBP-API returns but does not describe in its typed response docs: the resource docs (also for Domain APIs), the message-docs JSON schema, and
well_known_urisof/obp/v5.1.0/well-known, whose doc shows onlyjwks_uris. Not covered yet: paths the user picks while browsing (Try It and the generic/api/get|create|update|deleteproxy) and the gRPC page..github/workflows/tests.ymlruns the whole vitest suite (140 tests, no server and no settings needed) on every pull request.server/test/OBPClientService.test.tsis removed: it calledgetOAuthHeader, which the move to OAuth2 deleted, and neededVITE_OBP_API_HOSTto be set.